package com.ithuaxin.method;

import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {
        int []arr = {11,22,100,44,55,66,77,88,99,111};
        int []copyArr = copyOfRange(arr,1,10);
        for (int i = 0; i < copyArr.length; i++) {
            System.out.print(copyArr[i]+" ");
        }
    }
    public static int[] copyOfRange(int []arr,int from,int to){
        int arr2[] = new int[to-from];
        int index = 0;
        for (int i=from;i<to;i++){
            arr2[index] = arr[i];
            index++;
        }
        return arr2;
    }
}

